package com.example.a02back.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author SimpChaos
 * @since 2022-07-02
 */
@TableName("message")

public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 聊天消息ID
     */
    @TableId(value = "messageId", type = IdType.AUTO)
    private Long messageId;

    /**
     * 消息发送者ID
     */
    @TableField(value = "sender")
    private String sender;

    /**
     * 接收者ID
     */
    @TableField(value = "receiver")

    private String receiver;

    /**
     * 聊天室id
     */
    @TableField(value = "room_id")

    private String roomId;


    /**
     * 聊天消息内容
     */
    @TableField(value = "content")

    private String content;

    /**
     * 消息是否已读
     */
    @TableField(value = "isRead")

    private Integer isRead;

    /**
     * 网络请求ID
     */
    @TableField(value = "requestId")

    private String requestId;

    /**
     * 创建时间
     */
    @TableField(value = "createTime")

    private LocalDateTime createTime;

    public String getRoomId() {
        return roomId;
    }

    public void setRoomId(String roomId) {
        this.roomId = roomId;
    }

    @Override
    public String toString() {
        return "Message{" +
            "messageId=" + messageId +
            ", sender=" + sender +
            ", receiver=" + receiver +
            ", content=" + content +
            ", isRead=" + isRead +
            ", requestId=" + requestId +
            ", createTime=" + createTime +
        "}";
    }

    public Long getMessageId() {
        return messageId;
    }

    public void setMessageId(Long messageId) {
        this.messageId = messageId;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getIsRead() {
        return isRead;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
}
